import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/major_hazard/hazard_obligation_history_entity.dart';

HazardObligationHistoryEntity $HazardObligationHistoryEntityFromJson(Map<String, dynamic> json) {
  final HazardObligationHistoryEntity hazardObligationHistoryEntity = HazardObligationHistoryEntity();
  final int? checkCycle = jsonConvert.convert<int>(json['checkCycle']);
  if (checkCycle != null) {
    hazardObligationHistoryEntity.checkCycle = checkCycle;
  }
  final String? checkCycleUnit = jsonConvert.convert<String>(json['checkCycleUnit']);
  if (checkCycleUnit != null) {
    hazardObligationHistoryEntity.checkCycleUnit = checkCycleUnit;
  }
  final int? checkStatus = jsonConvert.convert<int>(json['checkStatus']);
  if (checkStatus != null) {
    hazardObligationHistoryEntity.checkStatus = checkStatus;
  }
  final String? checkTaskId = jsonConvert.convert<String>(json['checkTaskId']);
  if (checkTaskId != null) {
    hazardObligationHistoryEntity.checkTaskId = checkTaskId;
  }
  final String? checkTime = jsonConvert.convert<String>(json['checkTime']);
  if (checkTime != null) {
    hazardObligationHistoryEntity.checkTime = checkTime;
  }
  final String? checkUserId = jsonConvert.convert<String>(json['checkUserId']);
  if (checkUserId != null) {
    hazardObligationHistoryEntity.checkUserId = checkUserId;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    hazardObligationHistoryEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    hazardObligationHistoryEntity.createBy = createBy;
  }
  final String? createByDep = jsonConvert.convert<String>(json['createByDep']);
  if (createByDep != null) {
    hazardObligationHistoryEntity.createByDep = createByDep;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    hazardObligationHistoryEntity.createById = createById;
  }
  final String? createByMobile = jsonConvert.convert<String>(json['createByMobile']);
  if (createByMobile != null) {
    hazardObligationHistoryEntity.createByMobile = createByMobile;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    hazardObligationHistoryEntity.createDate = createDate;
  }
  final String? dangerInvestigationId = jsonConvert.convert<String>(json['dangerInvestigationId']);
  if (dangerInvestigationId != null) {
    hazardObligationHistoryEntity.dangerInvestigationId = dangerInvestigationId;
  }
  final String? hazardCode = jsonConvert.convert<String>(json['hazardCode']);
  if (hazardCode != null) {
    hazardObligationHistoryEntity.hazardCode = hazardCode;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    hazardObligationHistoryEntity.id = id;
  }
  final String? mobileMe = jsonConvert.convert<String>(json['mobileMe']);
  if (mobileMe != null) {
    hazardObligationHistoryEntity.mobileMe = mobileMe;
  }
  final String? riskEventId = jsonConvert.convert<String>(json['riskEventId']);
  if (riskEventId != null) {
    hazardObligationHistoryEntity.riskEventId = riskEventId;
  }
  final String? riskEventName = jsonConvert.convert<String>(json['riskEventName']);
  if (riskEventName != null) {
    hazardObligationHistoryEntity.riskEventName = riskEventName;
  }
  final String? riskMeasureDesc = jsonConvert.convert<String>(json['riskMeasureDesc']);
  if (riskMeasureDesc != null) {
    hazardObligationHistoryEntity.riskMeasureDesc = riskMeasureDesc;
  }
  final String? riskMeasureId = jsonConvert.convert<String>(json['riskMeasureId']);
  if (riskMeasureId != null) {
    hazardObligationHistoryEntity.riskMeasureId = riskMeasureId;
  }
  final String? riskObjectId = jsonConvert.convert<String>(json['riskObjectId']);
  if (riskObjectId != null) {
    hazardObligationHistoryEntity.riskObjectId = riskObjectId;
  }
  final String? riskObjectName = jsonConvert.convert<String>(json['riskObjectName']);
  if (riskObjectName != null) {
    hazardObligationHistoryEntity.riskObjectName = riskObjectName;
  }
  final String? riskUnitId = jsonConvert.convert<String>(json['riskUnitId']);
  if (riskUnitId != null) {
    hazardObligationHistoryEntity.riskUnitId = riskUnitId;
  }
  final String? riskUnitName = jsonConvert.convert<String>(json['riskUnitName']);
  if (riskUnitName != null) {
    hazardObligationHistoryEntity.riskUnitName = riskUnitName;
  }
  final String? taskNum = jsonConvert.convert<String>(json['taskNum']);
  if (taskNum != null) {
    hazardObligationHistoryEntity.taskNum = taskNum;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    hazardObligationHistoryEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    hazardObligationHistoryEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    hazardObligationHistoryEntity.updateDate = updateDate;
  }
  final String? workEndTime = jsonConvert.convert<String>(json['workEndTime']);
  if (workEndTime != null) {
    hazardObligationHistoryEntity.workEndTime = workEndTime;
  }
  final String? workStartTime = jsonConvert.convert<String>(json['workStartTime']);
  if (workStartTime != null) {
    hazardObligationHistoryEntity.workStartTime = workStartTime;
  }
  final String? workType = jsonConvert.convert<String>(json['workType']);
  if (workType != null) {
    hazardObligationHistoryEntity.workType = workType;
  }
  return hazardObligationHistoryEntity;
}

Map<String, dynamic> $HazardObligationHistoryEntityToJson(HazardObligationHistoryEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['checkCycle'] = entity.checkCycle;
  data['checkCycleUnit'] = entity.checkCycleUnit;
  data['checkStatus'] = entity.checkStatus;
  data['checkTaskId'] = entity.checkTaskId;
  data['checkTime'] = entity.checkTime;
  data['checkUserId'] = entity.checkUserId;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createByDep'] = entity.createByDep;
  data['createById'] = entity.createById;
  data['createByMobile'] = entity.createByMobile;
  data['createDate'] = entity.createDate;
  data['dangerInvestigationId'] = entity.dangerInvestigationId;
  data['hazardCode'] = entity.hazardCode;
  data['id'] = entity.id;
  data['mobileMe'] = entity.mobileMe;
  data['riskEventId'] = entity.riskEventId;
  data['riskEventName'] = entity.riskEventName;
  data['riskMeasureDesc'] = entity.riskMeasureDesc;
  data['riskMeasureId'] = entity.riskMeasureId;
  data['riskObjectId'] = entity.riskObjectId;
  data['riskObjectName'] = entity.riskObjectName;
  data['riskUnitId'] = entity.riskUnitId;
  data['riskUnitName'] = entity.riskUnitName;
  data['taskNum'] = entity.taskNum;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['workEndTime'] = entity.workEndTime;
  data['workStartTime'] = entity.workStartTime;
  data['workType'] = entity.workType;
  return data;
}

extension HazardObligationHistoryEntityExtension on HazardObligationHistoryEntity {
  HazardObligationHistoryEntity copyWith({
    int? checkCycle,
    String? checkCycleUnit,
    int? checkStatus,
    String? checkTaskId,
    String? checkTime,
    String? checkUserId,
    String? companyCode,
    String? createBy,
    String? createByDep,
    String? createById,
    String? createByMobile,
    String? createDate,
    String? dangerInvestigationId,
    String? hazardCode,
    String? id,
    String? mobileMe,
    String? riskEventId,
    String? riskEventName,
    String? riskMeasureDesc,
    String? riskMeasureId,
    String? riskObjectId,
    String? riskObjectName,
    String? riskUnitId,
    String? riskUnitName,
    String? taskNum,
    String? updateBy,
    String? updateById,
    String? updateDate,
    String? workEndTime,
    String? workStartTime,
    String? workType,
  }) {
    return HazardObligationHistoryEntity()
      ..checkCycle = checkCycle ?? this.checkCycle
      ..checkCycleUnit = checkCycleUnit ?? this.checkCycleUnit
      ..checkStatus = checkStatus ?? this.checkStatus
      ..checkTaskId = checkTaskId ?? this.checkTaskId
      ..checkTime = checkTime ?? this.checkTime
      ..checkUserId = checkUserId ?? this.checkUserId
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createByDep = createByDep ?? this.createByDep
      ..createById = createById ?? this.createById
      ..createByMobile = createByMobile ?? this.createByMobile
      ..createDate = createDate ?? this.createDate
      ..dangerInvestigationId = dangerInvestigationId ?? this.dangerInvestigationId
      ..hazardCode = hazardCode ?? this.hazardCode
      ..id = id ?? this.id
      ..mobileMe = mobileMe ?? this.mobileMe
      ..riskEventId = riskEventId ?? this.riskEventId
      ..riskEventName = riskEventName ?? this.riskEventName
      ..riskMeasureDesc = riskMeasureDesc ?? this.riskMeasureDesc
      ..riskMeasureId = riskMeasureId ?? this.riskMeasureId
      ..riskObjectId = riskObjectId ?? this.riskObjectId
      ..riskObjectName = riskObjectName ?? this.riskObjectName
      ..riskUnitId = riskUnitId ?? this.riskUnitId
      ..riskUnitName = riskUnitName ?? this.riskUnitName
      ..taskNum = taskNum ?? this.taskNum
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..workEndTime = workEndTime ?? this.workEndTime
      ..workStartTime = workStartTime ?? this.workStartTime
      ..workType = workType ?? this.workType;
  }
}
